.class public Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;
.super Landroid/app/Activity;
.source "OfferWallActivity.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$MobileOfferWallTemplate;,
        Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;,
        Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$UnlockOfferWallTemplate;
    }
.end annotation


# static fields
.field private static final APPID_KEY:Ljava/lang/String; = "app.id.key"

.field public static final EXTRA_CREDENTIALS_TOKEN_KEY:Ljava/lang/String; = "EXTRA_CREDENTIALS_TOKEN_KEY"

.field public static final EXTRA_CURRENCY_NAME_KEY:Ljava/lang/String; = "EXTRA_CURRENCY_NAME_KEY"

.field public static final EXTRA_KEYS_VALUES_MAP_KEY:Ljava/lang/String; = "EXTRA_KEY_VALUES_MAP"

.field public static final EXTRA_OFFERWALL_TYPE:Ljava/lang/String; = "EXTRA_OFFERWALL_TEMPLATE_KEY"

.field public static final EXTRA_SHOULD_STAY_OPEN_KEY:Ljava/lang/String; = "EXTRA_SHOULD_REMAIN_OPEN_KEY"

.field public static final OFFERWALL_TYPE_MOBILE:Ljava/lang/String; = "OFFERWALL_TYPE_MOBILE"

.field public static final OFFERWALL_TYPE_UNLOCK:Ljava/lang/String; = "OFFERWALL_TYPE_UNLOCK"

.field public static final RESULT_CODE_NO_STATUS_CODE:I = -0xa

.field private static final SECURITY_TOKEN_KEY:Ljava/lang/String; = "security.token.key"

.field private static final UID_KEY:Ljava/lang/String; = "user.id.key"


# instance fields
.field private mActivityOfferWebClient:Lcom/sponsorpay/sdk/android/publisher/ActivityOfferWebClient;

.field private mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

.field private mCurrencyName:Ljava/lang/String;

.field protected mCustomKeysValues:Ljava/util/Map;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/Map",
            "<",
            "Ljava/lang/String;",
            "Ljava/lang/String;",
            ">;"
        }
    .end annotation
.end field

.field private mErrorDialog:Landroid/app/AlertDialog;

.field private mProgressDialog:Landroid/app/ProgressDialog;

.field private mShouldStayOpen:Z

.field private mTemplate:Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;

.field protected mWebView:Landroid/webkit/WebView;


# direct methods
.method public constructor <init>()V
    .locals 0

    .prologue
    .line 37
    invoke-direct {p0}, Landroid/app/Activity;-><init>()V

    return-void
.end method

.method static synthetic access$0(Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;)Landroid/app/ProgressDialog;
    .locals 1
    .parameter

    .prologue
    .line 83
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    return-object v0
.end method

.method static synthetic access$1(Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;Landroid/app/ProgressDialog;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 83
    iput-object p1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    return-void
.end method

.method private buildUrl()Ljava/lang/String;
    .locals 3

    .prologue
    .line 246
    iget-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mTemplate:Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;

    iget-object v2, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCustomKeysValues:Ljava/util/Map;

    invoke-virtual {v1, v2}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;->addAdditionalParameters(Ljava/util/Map;)Ljava/util/Map;

    move-result-object v1

    iput-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCustomKeysValues:Ljava/util/Map;

    .line 247
    iget-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mTemplate:Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;

    invoke-virtual {v1}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;->getBaseUrl()Ljava/lang/String;

    move-result-object v0

    .line 248
    .local v0, baseUrl:Ljava/lang/String;
    iget-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-static {v0, v1}, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->newBuilder(Ljava/lang/String;Lcom/sponsorpay/sdk/android/credentials/SPCredentials;)Lcom/sponsorpay/sdk/android/utils/UrlBuilder;

    move-result-object v1

    iget-object v2, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCurrencyName:Ljava/lang/String;

    invoke-virtual {v1, v2}, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->setCurrency(Ljava/lang/String;)Lcom/sponsorpay/sdk/android/utils/UrlBuilder;

    move-result-object v1

    .line 249
    iget-object v2, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCustomKeysValues:Ljava/util/Map;

    invoke-virtual {v1, v2}, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->addExtraKeysValues(Ljava/util/Map;)Lcom/sponsorpay/sdk/android/utils/UrlBuilder;

    move-result-object v1

    invoke-virtual {v1}, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->addScreenMetrics()Lcom/sponsorpay/sdk/android/utils/UrlBuilder;

    move-result-object v1

    invoke-virtual {v1}, Lcom/sponsorpay/sdk/android/utils/UrlBuilder;->buildUrl()Ljava/lang/String;

    move-result-object v1

    .line 248
    return-object v1
.end method

.method private deleteCredentialsValues()V
    .locals 3

    .prologue
    .line 279
    const/4 v2, 0x0

    invoke-virtual {p0, v2}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getPreferences(I)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 280
    .local v0, preferences:Landroid/content/SharedPreferences;
    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    .line 281
    .local v1, prefsEditor:Landroid/content/SharedPreferences$Editor;
    invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->clear()Landroid/content/SharedPreferences$Editor;

    .line 282
    invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 283
    return-void
.end method

.method private instantiateTemplate()V
    .locals 3

    .prologue
    .line 173
    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getIntent()Landroid/content/Intent;

    move-result-object v1

    const-string v2, "EXTRA_OFFERWALL_TEMPLATE_KEY"

    invoke-virtual {v1, v2}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 175
    .local v0, templateName:Ljava/lang/String;
    const-string v1, "OFFERWALL_TYPE_UNLOCK"

    invoke-virtual {v1, v0}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 176
    new-instance v1, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$UnlockOfferWallTemplate;

    invoke-direct {v1, p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$UnlockOfferWallTemplate;-><init>(Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;)V

    iput-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mTemplate:Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;

    .line 180
    :goto_0
    return-void

    .line 178
    :cond_0
    new-instance v1, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$MobileOfferWallTemplate;

    invoke-direct {v1, p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$MobileOfferWallTemplate;-><init>(Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;)V

    iput-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mTemplate:Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;

    goto :goto_0
.end method

.method private restoreCredentialsValues()V
    .locals 6

    .prologue
    .line 286
    const/4 v4, 0x0

    invoke-virtual {p0, v4}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getPreferences(I)Landroid/content/SharedPreferences;

    move-result-object v1

    .line 287
    .local v1, preferences:Landroid/content/SharedPreferences;
    const-string v4, "app.id.key"

    const-string v5, ""

    invoke-interface {v1, v4, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 288
    .local v0, appId:Ljava/lang/String;
    const-string v4, "user.id.key"

    const-string v5, ""

    invoke-interface {v1, v4, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v3

    .line 289
    .local v3, userId:Ljava/lang/String;
    const-string v4, "security.token.key"

    const-string v5, ""

    invoke-interface {v1, v4, v5}, Landroid/content/SharedPreferences;->getString(Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 290
    .local v2, securityToken:Ljava/lang/String;
    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v4

    invoke-static {v0, v3, v2, v4}, Lcom/sponsorpay/sdk/android/SponsorPay;->start(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Landroid/content/Context;)Ljava/lang/String;

    .line 291
    invoke-static {}, Lcom/sponsorpay/sdk/android/SponsorPay;->getCurrentCredentials()Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    move-result-object v4

    iput-object v4, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    .line 292
    return-void
.end method

.method private storeCrendentialsValues()V
    .locals 4

    .prologue
    .line 270
    const/4 v2, 0x0

    invoke-virtual {p0, v2}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getPreferences(I)Landroid/content/SharedPreferences;

    move-result-object v0

    .line 271
    .local v0, preferences:Landroid/content/SharedPreferences;
    invoke-interface {v0}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;

    move-result-object v1

    .line 272
    .local v1, prefsEditor:Landroid/content/SharedPreferences$Editor;
    const-string v2, "app.id.key"

    iget-object v3, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-virtual {v3}, Lcom/sponsorpay/sdk/android/credentials/SPCredentials;->getAppId()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 273
    const-string v2, "user.id.key"

    iget-object v3, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-virtual {v3}, Lcom/sponsorpay/sdk/android/credentials/SPCredentials;->getUserId()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 274
    const-string v2, "security.token.key"

    iget-object v3, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    invoke-virtual {v3}, Lcom/sponsorpay/sdk/android/credentials/SPCredentials;->getSecurityToken()Ljava/lang/String;

    move-result-object v3

    invoke-interface {v1, v2, v3}, Landroid/content/SharedPreferences$Editor;->putString(Ljava/lang/String;Ljava/lang/String;)Landroid/content/SharedPreferences$Editor;

    .line 275
    invoke-interface {v1}, Landroid/content/SharedPreferences$Editor;->commit()Z

    .line 276
    return-void
.end method


# virtual methods
.method protected fetchPassedExtras()V
    .locals 7

    .prologue
    .line 185
    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getIntent()Landroid/content/Intent;

    move-result-object v4

    const-string v5, "EXTRA_CREDENTIALS_TOKEN_KEY"

    invoke-virtual {v4, v5}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v0

    .line 188
    .local v0, credentialsToken:Ljava/lang/String;
    :try_start_0
    invoke-static {v0}, Lcom/sponsorpay/sdk/android/SponsorPay;->getCredentials(Ljava/lang/String;)Lcom/sponsorpay/sdk/android/credentials/SPCredentials;

    move-result-object v4

    iput-object v4, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCredentials:Lcom/sponsorpay/sdk/android/credentials/SPCredentials;
    :try_end_0
    .catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0

    .line 196
    :goto_0
    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getIntent()Landroid/content/Intent;

    move-result-object v4

    const-string v5, "EXTRA_SHOULD_REMAIN_OPEN_KEY"

    .line 197
    iget-object v6, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mTemplate:Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;

    invoke-virtual {v6}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;->shouldStayOpenByDefault()Z

    move-result v6

    .line 196
    invoke-virtual {v4, v5, v6}, Landroid/content/Intent;->getBooleanExtra(Ljava/lang/String;Z)Z

    move-result v4

    iput-boolean v4, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mShouldStayOpen:Z

    .line 199
    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getIntent()Landroid/content/Intent;

    move-result-object v4

    const-string v5, "EXTRA_KEY_VALUES_MAP"

    invoke-virtual {v4, v5}, Landroid/content/Intent;->getSerializableExtra(Ljava/lang/String;)Ljava/io/Serializable;

    move-result-object v3

    .line 200
    .local v3, inflatedKvMap:Ljava/io/Serializable;
    instance-of v4, v3, Ljava/util/HashMap;

    if-eqz v4, :cond_0

    .line 201
    check-cast v3, Ljava/util/HashMap;

    .end local v3           #inflatedKvMap:Ljava/io/Serializable;
    iput-object v3, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCustomKeysValues:Ljava/util/Map;

    .line 204
    :cond_0
    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getIntent()Landroid/content/Intent;

    move-result-object v4

    const-string v5, "EXTRA_CURRENCY_NAME_KEY"

    invoke-virtual {v4, v5}, Landroid/content/Intent;->getStringExtra(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v1

    .line 206
    .local v1, currencyName:Ljava/lang/String;
    invoke-static {v1}, Lcom/sponsorpay/sdk/android/utils/StringUtils;->notNullNorEmpty(Ljava/lang/String;)Z

    move-result v4

    if-eqz v4, :cond_1

    .line 207
    iput-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mCurrencyName:Ljava/lang/String;

    .line 210
    :cond_1
    iget-object v4, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mTemplate:Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;

    invoke-virtual {v4}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$OfferWallTemplate;->fetchAdditionalExtras()V

    .line 211
    return-void

    .line 189
    .end local v1           #currencyName:Ljava/lang/String;
    :catch_0
    move-exception v2

    .line 192
    .local v2, e:Ljava/lang/RuntimeException;
    invoke-direct {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->restoreCredentialsValues()V

    .line 193
    invoke-direct {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->deleteCredentialsValues()V

    goto :goto_0
.end method

.method protected onCreate(Landroid/os/Bundle;)V
    .locals 3
    .parameter "savedInstanceState"

    .prologue
    const/4 v2, 0x1

    .line 109
    invoke-super {p0, p1}, Landroid/app/Activity;->onCreate(Landroid/os/Bundle;)V

    .line 111
    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getWindow()Landroid/view/Window;

    move-result-object v0

    invoke-virtual {v0, v2}, Landroid/view/Window;->requestFeature(I)Z

    .line 113
    new-instance v0, Landroid/app/ProgressDialog;

    invoke-direct {v0, p0}, Landroid/app/ProgressDialog;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    .line 114
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    invoke-virtual {v0, p0}, Landroid/app/ProgressDialog;->setOwnerActivity(Landroid/app/Activity;)V

    .line 115
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    invoke-virtual {v0, v2}, Landroid/app/ProgressDialog;->setIndeterminate(Z)V

    .line 116
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    .line 117
    sget-object v1, Lcom/sponsorpay/sdk/android/publisher/SponsorPayPublisher$UIStringIdentifier;->LOADING_OFFERWALL:Lcom/sponsorpay/sdk/android/publisher/SponsorPayPublisher$UIStringIdentifier;

    invoke-static {v1}, Lcom/sponsorpay/sdk/android/publisher/SponsorPayPublisher;->getUIString(Lcom/sponsorpay/sdk/android/publisher/SponsorPayPublisher$UIStringIdentifier;)Ljava/lang/String;

    move-result-object v1

    .line 116
    invoke-virtual {v0, v1}, Landroid/app/ProgressDialog;->setMessage(Ljava/lang/CharSequence;)V

    .line 118
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    invoke-virtual {v0}, Landroid/app/ProgressDialog;->show()V

    .line 120
    invoke-direct {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->instantiateTemplate()V

    .line 122
    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->fetchPassedExtras()V

    .line 124
    new-instance v0, Landroid/webkit/WebView;

    invoke-virtual {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->getApplicationContext()Landroid/content/Context;

    move-result-object v1

    invoke-direct {v0, v1}, Landroid/webkit/WebView;-><init>(Landroid/content/Context;)V

    iput-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mWebView:Landroid/webkit/WebView;

    .line 125
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mWebView:Landroid/webkit/WebView;

    const/4 v1, 0x0

    invoke-virtual {v0, v1}, Landroid/webkit/WebView;->setScrollBarStyle(I)V

    .line 126
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {p0, v0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->setContentView(Landroid/view/View;)V

    .line 128
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v0}, Landroid/webkit/WebView;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v0

    invoke-virtual {v0, v2}, Landroid/webkit/WebSettings;->setJavaScriptEnabled(Z)V

    .line 129
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v0}, Landroid/webkit/WebView;->getSettings()Landroid/webkit/WebSettings;

    move-result-object v0

    invoke-virtual {v0, v2}, Landroid/webkit/WebSettings;->setPluginsEnabled(Z)V

    .line 131
    new-instance v0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$1;

    .line 132
    iget-boolean v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mShouldStayOpen:Z

    invoke-direct {v0, p0, p0, v1}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$1;-><init>(Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;Landroid/app/Activity;Z)V

    .line 131
    iput-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mActivityOfferWebClient:Lcom/sponsorpay/sdk/android/publisher/ActivityOfferWebClient;

    .line 156
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mWebView:Landroid/webkit/WebView;

    iget-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mActivityOfferWebClient:Lcom/sponsorpay/sdk/android/publisher/ActivityOfferWebClient;

    invoke-virtual {v0, v1}, Landroid/webkit/WebView;->setWebViewClient(Landroid/webkit/WebViewClient;)V

    .line 159
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mWebView:Landroid/webkit/WebView;

    new-instance v1, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$2;

    invoke-direct {v1, p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity$2;-><init>(Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;)V

    invoke-virtual {v0, v1}, Landroid/webkit/WebView;->setWebChromeClient(Landroid/webkit/WebChromeClient;)V

    .line 170
    return-void
.end method

.method protected onPause()V
    .locals 2

    .prologue
    const/4 v1, 0x0

    .line 215
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mErrorDialog:Landroid/app/AlertDialog;

    if-eqz v0, :cond_0

    .line 216
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mErrorDialog:Landroid/app/AlertDialog;

    invoke-virtual {v0}, Landroid/app/AlertDialog;->dismiss()V

    .line 217
    iput-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mErrorDialog:Landroid/app/AlertDialog;

    .line 219
    :cond_0
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    if-eqz v0, :cond_1

    .line 220
    iget-object v0, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    invoke-virtual {v0}, Landroid/app/ProgressDialog;->dismiss()V

    .line 221
    iput-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mProgressDialog:Landroid/app/ProgressDialog;

    .line 223
    :cond_1
    invoke-direct {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->storeCrendentialsValues()V

    .line 224
    invoke-super {p0}, Landroid/app/Activity;->onPause()V

    .line 225
    return-void
.end method

.method protected onResume()V
    .locals 5

    .prologue
    .line 232
    invoke-super {p0}, Landroid/app/Activity;->onResume()V

    .line 234
    :try_start_0
    invoke-direct {p0}, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->buildUrl()Ljava/lang/String;

    move-result-object v1

    .line 236
    .local v1, offerwallUrl:Ljava/lang/String;
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v2

    new-instance v3, Ljava/lang/StringBuilder;

    const-string v4, "Offerwall request url: "

    invoke-direct {v3, v4}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v3}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v3

    invoke-static {v2, v3}, Lcom/sponsorpay/sdk/android/utils/SponsorPayLogger;->d(Ljava/lang/String;Ljava/lang/String;)V

    .line 237
    iget-object v2, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mWebView:Landroid/webkit/WebView;

    invoke-virtual {v2, v1}, Landroid/webkit/WebView;->loadUrl(Ljava/lang/String;)V
    :try_end_0
    .catch Ljava/lang/RuntimeException; {:try_start_0 .. :try_end_0} :catch_0

    .line 243
    .end local v1           #offerwallUrl:Ljava/lang/String;
    :goto_0
    return-void

    .line 238
    :catch_0
    move-exception v0

    .line 239
    .local v0, ex:Ljava/lang/RuntimeException;
    invoke-virtual {p0}, Ljava/lang/Object;->getClass()Ljava/lang/Class;

    move-result-object v2

    invoke-virtual {v2}, Ljava/lang/Class;->getSimpleName()Ljava/lang/String;

    move-result-object v2

    .line 240
    const-string v3, "An exception occurred when launching the Offer Wall"

    .line 239
    invoke-static {v2, v3, v0}, Lcom/sponsorpay/sdk/android/utils/SponsorPayLogger;->e(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Exception;)V

    .line 241
    iget-object v2, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mActivityOfferWebClient:Lcom/sponsorpay/sdk/android/publisher/ActivityOfferWebClient;

    invoke-virtual {v0}, Ljava/lang/RuntimeException;->getMessage()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/sponsorpay/sdk/android/publisher/ActivityOfferWebClient;->showDialog(Ljava/lang/String;)V

    goto :goto_0
.end method

.method protected showErrorDialog(Lcom/sponsorpay/sdk/android/publisher/SponsorPayPublisher$UIStringIdentifier;)V
    .locals 2
    .parameter "error"

    .prologue
    .line 259
    invoke-static {p1}, Lcom/sponsorpay/sdk/android/publisher/SponsorPayPublisher;->getUIString(Lcom/sponsorpay/sdk/android/publisher/SponsorPayPublisher$UIStringIdentifier;)Ljava/lang/String;

    move-result-object v0

    .line 260
    .local v0, errorMessage:Ljava/lang/String;
    iget-object v1, p0, Lcom/sponsorpay/sdk/android/publisher/OfferWallActivity;->mActivityOfferWebClient:Lcom/sponsorpay/sdk/android/publisher/ActivityOfferWebClient;

    invoke-virtual {v1, v0}, Lcom/sponsorpay/sdk/android/publisher/ActivityOfferWebClient;->showDialog(Ljava/lang/String;)V

    .line 261
    return-void
.end method
